﻿<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>Title</title>
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="${ctx}/common/plugins/layuiadmin/style/admin.css" media="all">
    <link rel="stylesheet" href="${ctx}/common/common.css" media="all">
    <script src="${ctx}/common/plugins/layuiadmin/layui/layui.js"></script>
    
    <style type="text/css">
        .rowtop {
            padding: 10px;
        }
    </style>
</head>
<body>
<form class="layui-form layui-container" action="${ctx}/enterprise/${action}" style="background-color: white;">
    <input type="hidden" name="id" value="${entity.id}" />
    <input type="hidden" name="companyId" value="${companyId}" />
    <div class="layui-row rowtop" style="margin-top: 20px;">
        <div class="layui-col-md5">
            <label class="layui-form-label">姓名<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="name" required value="${entity.name}" lay-verify="required" placeholder="请输入姓名" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">性别<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="gender" lay-verify="required" value="${entity.gender}" placeholder="请输入性别" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">出生日期<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="birthday" required value="${entity.birthday}" lay-verify="required" placeholder="请输入出生日期" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">证件类型<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="cardType" lay-verify="required" value="${entity.cardType}" placeholder="请输入证件类型" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">证件号码/代表证编号<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="identityCard" required value="${entity.identityCard}" lay-verify="required" placeholder="请输入证件号码/代表证编号" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">职务<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="post" lay-verify="required" value="${entity.post}" placeholder="职务" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">联系电话<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="phone" required value="${entity.phone}" lay-verify="required" placeholder="请输入联系电话" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">电子邮箱<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="eMail" lay-verify="required" value="${entity.eMail}" placeholder="请输入电子邮箱" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">住址<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="address" required value="${entity.address}" lay-verify="required" placeholder="请输入住址" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">代表证期限自/任职起始日期<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="postStartDate" lay-verify="required" value="${entity.postStartDate}" placeholder="请输入代表证期限自/任职起始日期" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-col-md5">
            <label class="layui-form-label">代表证期限至/任职截止日期<span style="color: red">*</span></label>
            <div class="layui-input-block">
                <input type="text" name="postEndDate" required value="${entity.postEndDate}" lay-verify="required" placeholder="请输入代表证期限至/任职截止日期" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" id="formBtn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
            <button type="button" id="rollback" class="layui-btn layui-btn-primary">返回</button>
        </div>
    </div>
</form>

<script>
    // 使用 Layui 的表单模块
    layui.use('form', function() {
        var form = layui.form;

        // 监听表单提交
        form.on('submit(formDemo)', function(data) {
            layer.load(1, {
                shade: [0.1, '#fff'] // 0.1透明度的白色背景
            });
            $("#formBtn").attr("disabled", true); // 禁用提交按钮，防止重复提交
        });
    });

    // 返回按钮点击事件
    document.getElementById("rollback").addEventListener("click", function() {
        window.history.back(); // 返回上一页
    });
</script>
</body>
</html>
